package com.cw.spider.entity;

import java.util.List;

/**
 * 描述:
 *
 * @author withqianqian@163.com
 * @create 2020-08-28 14:10
 */
public class NewsModel {
    //标题
    private String title;
    //发布时间
    private String publishTime;
    //正文
    private List<String> content;
    //链接
    private String url;
    //作者
    private String author;
    //来源
    private String source;
    //描述
    private String description;

    //索引
    private String pIndex;

    private NewsModel(Builder builder) {
        title = builder.title;
        publishTime = builder.publishTime;
        content = builder.content;
        url = builder.url;
        author = builder.author;
        source = builder.source;
        description = builder.description;
        pIndex = builder.pIndex;
    }


    public static final class Builder {
        private String title;
        private String publishTime;
        private List<String> content;
        private String url;
        private String author;
        private String source;
        private String description;
        private String pIndex;

        public Builder() {
        }

        public Builder title(String val) {
            title = val;
            return this;
        }

        public Builder publishTime(String val) {
            publishTime = val;
            return this;
        }

        public Builder content(List<String> val) {
            content = val;
            return this;
        }

        public Builder url(String val) {
            url = val;
            return this;
        }

        public Builder author(String val) {
            author = val;
            return this;
        }

        public Builder source(String val) {
            source = val;
            return this;
        }
        public Builder description(String val) {
            description = val;
            return this;
        }
        public Builder pIndex(String val) {
            pIndex = val;
            return this;
        }
        public NewsModel build() {
            return new NewsModel(this);
        }
    }

    @Override
    public String toString() {
        return "NewsModel{" +
                "title='" + title + '\'' +
                ", publishTime='" + publishTime + '\'' +
                ", content=" + content +
                ", url='" + url + '\'' +
                ", author='" + author + '\'' +
                ", source='" + source + '\'' +
                '}';
    }
}
